package com.cdgeekcamp.redas.wechat.entity;

import com.cdgeekcamp.redas.wechat.service.MsgHandlerService;

/**
 * 事件消息
 */
public class EventMessageEntity extends MessageBaseEntity {
    // 事件类型
    private String Event;
    // 事件key
    private String EventKey;
    // 二维码的ticket，可用来换取二维码图片
    private String Ticket;

    public EventMessageEntity() {
    }

    public EventMessageEntity(String fromUserName, String toUserName, Long createTime, String msgType) {
        super(fromUserName, toUserName, createTime, msgType);
    }

    public EventMessageEntity(String event, String eventKey, String ticket) {
        Event = event;
        EventKey = eventKey;
        Ticket = ticket;
    }

    public EventMessageEntity(String fromUserName, String toUserName, Long createTime, String msgType, String event, String eventKey, String ticket) {
        super(fromUserName, toUserName, createTime, msgType);
        Event = event;
        EventKey = eventKey;
        Ticket = ticket;
    }

    public String getEvent() {
        return Event;
    }

    public void setEvent(String event) {
        Event = event;
    }

    public String getEventKey() {
        return EventKey;
    }

    public void setEventKey(String eventKey) {
        EventKey = eventKey;
    }

    public String getTicket() {
        return Ticket;
    }

    public void setTicket(String ticket) {
        Ticket = ticket;
    }

    @Override
    public String doReply() {
        return new MsgHandlerService().eventHandler(this);
    }
}
